﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DynConDevCorp.OpenArch.SmartData.Interfaces;

namespace DynConDevCorp.OpenArch.SmartData.Core.DisplayFormatters
{
    class DisplayFormatterFactory
    {
        private DisplayFormatterFactory()
        {
            
        }

        public static DisplayFormatterFactory GlobalInstance { get { return s_GlobalInstance;  } }
        private static readonly DisplayFormatterFactory s_GlobalInstance = new DisplayFormatterFactory();

        public ISmartDisplayFormatter GetDefaultFormatter<TData>()
        {
            Type dataType = typeof (TData);
            if (dataType == typeof(string))
                return new SmartDisplayFormatter<string>();
            else
                return new SmartDisplayFormatter<TData>();

        }
    }
}
